/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package anjos.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Junior
 */
@Embeddable
public class AnjoEventoPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "anjo_id")
    private int anjoId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "evento_id")
    private int eventoId;

    public AnjoEventoPK() {
    }

    public AnjoEventoPK(int anjoId, int eventoId) {
        this.anjoId = anjoId;
        this.eventoId = eventoId;
    }

    public int getAnjoId() {
        return anjoId;
    }

    public void setAnjoId(int anjoId) {
        this.anjoId = anjoId;
    }

    public int getEventoId() {
        return eventoId;
    }

    public void setEventoId(int eventoId) {
        this.eventoId = eventoId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) anjoId;
        hash += (int) eventoId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AnjoEventoPK)) {
            return false;
        }
        AnjoEventoPK other = (AnjoEventoPK) object;
        if (this.anjoId != other.anjoId) {
            return false;
        }
        if (this.eventoId != other.eventoId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "anjos.modelo.AnjoEventoPK[ anjoId=" + anjoId + ", eventoId=" + eventoId + " ]";
    }
    
}
